﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Xml;
using FreesenseSubAIS.ImageProcess;
namespace FreesenseSubAIS
{
    [Serializable]
    public class DeviceParameter
    {
        public DeviceParameter()
        {

        }
        public string IOCardComName { get; set; }
        public string PassWord { get; set; }
        public string RemoteLogPath { get; set; }//日志保存路径
        public string StationNO { get; set; }//生产线
        public string DustLightCom { get; set; }//上测光
        public string DustLightDownCom { get; set; }//下侧光
        public string BackLightCom { get; set; }//背光
        public string BackRightLightCom { get; set; }//二号右侧光除尘串口
        public string DefaultProductId { get; set; }//默认检测产品类型
        public string CurentOperator { get; set; }
        public int Count { get; set; }
        public byte IOODownSwitchPic { get; set; }//IO卡切图输出口
        public byte SideLight1Channle { get; set; }//侧光源左侧光1号通道，上测光
        public byte SideLight2Channle { get; set; }//侧光源右侧光2号通道，下测光
        public byte BackLightChannle { get; set; }//左、右背光源1号通道
        public List<CameraInfomation> CameraList { get; set; }//相机列表
        public CameraInfomation SubNetInfo { get; set; }//从机IP设置
        public bool SaveInspImage { get; set; }//保存NG图片
        public bool SaveNgImage { get; set; }//保存NG图片
        public string SubnetIP { get; set; }//从机IP
        public string PortNum { get; set; }//从机端口号
        public byte IOinput { get; set; }//PLC输入到位信号
        public byte IOoutputNG { get; set; }//IO卡输出NG信号
        public byte IOoutputOK { get; set; }//IO卡输出OK信号
        public static DeviceParameter GetDefaultDeviceParameter()
        {
            DeviceParameter dp = new DeviceParameter();
            dp.IOCardComName = "com5";
            dp.DustLightCom = "com4";
            dp.DustLightDownCom = "com2";
            dp.BackLightCom = "com7";
            dp.BackRightLightCom = "com8";
            dp.StationNO = "0";
            dp.DefaultProductId = "0418";
            dp.IOODownSwitchPic = 1;
            dp.BackLightChannle = 1;
            dp.SideLight1Channle = 1;
            dp.SideLight2Channle = 2;

            dp.PassWord = "freesense";
            dp.Count = 0;
            dp.CameraList = new List<CameraInfomation>();
            return dp;
        }




        public int Subindex { get; set; }
        public MesManage MesClient { get; set; }

        public string EquipID { get; set; }

        public bool MseEnable { get; set; }

        public string BatchCode { get; set; }
    }
    [Serializable]
    public class MesManage
    {
        //private List<MesItem> _MesList;
        public MesManage()
        {

        }

        public List<MesItem> MesList { get; set; }
        public int FileNameMode { get; set; }
        public string FileMode { get; set; }
        public string DateFormat { get; set; }
    }
    [Serializable]
    public class MesItem
    {
        public MesItem()
        {
        }

        public string Item1 { get; set; }
        public string Item2 { get; set; }
        public bool Item3 { get; set; }
    }
    [Serializable]
    public class CameraInfomation
    {
        public string MacAddr;//相机Mac地址
        public string CameraName;//相机名
        public string CameraIp;//相机IP
        public string SubnetMask;//子网掩码
        public string DefaultGateway;//默认网关
        public string LocalAdapterName;//本地网卡名
        public string LocalIP;//本地IP
        public int CameraType;//相机类型
        public bool Enable;//是否启用
    }
}
